<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
        Promise:   ES6内置的类, 承诺   处理异步问题的:状态机
        */
        /* 
        三种状态:
             -1.pending: 默认状态: pending  等待 ;             PromiseResult  是undefined
             -2.fulfilled:  在回调函数里调取 resolve 方法 promise对象状态会变成fulfilled状态 resolved  PromiseResult :是传递的参数
             -3.rejected: 调取reject 的时候 变成 rejected状态  失败的状态  PromiseResult: 是传递的参数
        */

        let p = new Promise((resolve, reject) => {
            resolve(222);
            // reject("err")
        })
        console.log(p);



       
    </script>
</body>

</html>